import React, {Component} from 'react';
import {is, fromJS} from 'immutable';
import {NavLink} from 'react-router-dom';
import PropTypes from 'prop-types';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import {connect} from 'react-redux';
import './img.less';

export default class WeImg extends Component {


    constructor(props) {
        super(props);

        this.state = {
            src: null
        };
    }

    async componentDidMount() {
        const src = await import(this.props.src);
        this.state.src = src;
        this.state.className = this.props.className;
        this.setState(this.state);
    }


    render() {
        return (
            this.state.src && <img  className={this.state.className} src={this.state.src} />
        );
    }
}
